package chixing.day16.work;

import java.io.*;

public class copy {
    public static void main(String[] args) {
        InputStream os = null;
        try {
            os = new FileInputStream("D:\\a\\b\\dd.png");
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
        byte[] bytes;
        try {
            bytes = new byte[os.available()];
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        int temp;
        int i=0;
        try{
            while((temp = os.read())!=-1)
                bytes[i++] = (byte) temp;
        }catch (IOException e) {
            throw new RuntimeException(e);
        }
        OutputStream os1 = null;
        try {
            os1 = new FileOutputStream("D:\\a1\\c\\d.png");
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
        try {
            os1.write(bytes);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        finally {
        }
        try {
            os.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        try {
            os1.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
